<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 计算器 -->
      <input type="text" id="in1" value="">
          <select id="sel">
              <option value="+">+</option>
              <option value="-">-</option>
              <option value="*">*</option>
              <option value="/">/</option>
              </select>
          <input type="text" id="in2" value="">
          <button id="huan">=</button>
          <input type="text" id="chu" value="">
       

    <script>
        huan.onclick = function () {
            var a = Number(in1.value)
            var b = sel.value
            var c = Number(in2.value)

            if (b == "+") {
                chu.value = a + c;
            } else if (b == "-") {
                chu.value = a - c;
            } else if (b == "*") {
                chu.value = a * c;
            } else if (b == "/") {
                chu.value = a / c;
            } else {}
        }
    </script>
</body>

</html>